Adopt core 0.5.0: scoped command registration - #7
Merged
Conversation
Bump the edgecommons pin to the rust-lib/v0.5.0 tag (a14a328) and migrate the control plane to 0.5.0's breaking two-form registration (DESIGN-scoped-commands D-SC-1/D-SC-2): every verb declares a CommandScope and every handler receives the addressed instance. get-status and trigger declare CommandScope::Both. "No instance named" has always carried a meaningful component-wide answer for these two -- the roster plus summary, and "every active instance" -- rather than being a default to resolve, which is exactly D-SC-3's dual-semantics use. set-activation declares CommandScope::Instance: it never had an "all" form, and per D-SC-4 its INSTANCE_REQUIRED policy and the UNKNOWN_INSTANCE check stay component-side, since the library owns addressing and not configuration knowledge. A new `address()` folds the topic-addressed instance into the request's `instance` body selector, so each handler keeps reading exactly one selector whichever inbox the request arrived on. The topic wins (D-SC-4); in practice it can only fill in a missing value, because the library already refuses a topic/body conflict with BAD_ARGS before dispatch. The `instance` body field is unchanged for component-addressed callers. Docs: messaging-interface gains a Scope column, an "Addressing an instance" section, and the per-instance inbox topic; data-types and the how-to activation recipe describe both ways to name an instance; DESIGN §16's migration banner carries the scope table and rationale, and AGENTS.md the convention. Validation: cargo test 617 passed across all targets (583 lib) with the CI feature set, clippy -D warnings clean, coverage 93.43% lines against the 90% gate (control.rs 99.11%).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the core 0.5.0 coordinated wave (
DESIGN-scoped-commands.md§3 step 3). This repo did not compile against coremainafter the breakingregistersignature change.What changed
36a70c4(pre-0.5.0) to therust-lib/v0.5.0tag,a14a328.Cargo.lockregenerated with the local[patch]override inactive, so it records the git pin.register(verb, scope, handler)with(request, addressed_instance)handlers.Verb scope decisions
get-statusBothtriggerBothscope: "all")set-activationInstanceINSTANCE_REQUIREDUNKNOWN_INSTANCEcheck stay component-side — the library owns addressing, not configuration knowledge.A new
address()folds the topic-addressed instance into the request'sinstancebody selector, so each handler keeps reading exactly one selector whichever inbox the request arrived on. The topic wins (D-SC-4); in practice it can only fill in a missing value, because the library already refuses a topic/body.instanceconflict withBAD_ARGSbefore dispatch. Theinstancebody field is unchanged for component-addressed callers, so no existing caller breaks.Two unit tests cover the new resolution (topic wins over body; a non-object body still carries the addressing).
Docs
docs/reference/messaging-interface.md(Scope column, new "Addressing an instance" section, the per-instance inbox topic, corrected{instance}grammar note),docs/reference/data-types.md,docs/how-to-guides.md(the activation recipe now shows the instance-addressed topic and its component-topic equivalent),DESIGN.md§16 (scope table + rationale in the migration banner),AGENTS.md.Validation
cargo test --features dest-s3,dest-sftp,dest-ftps,dest-http,dest-azure,dest-gcs— 617 passed across all targets (583 lib + integration), 0 failed. Baseline on this branch before the change: green.cargo clippy --all-targets --features <same> -- -D warnings— clean.cargo llvm-covwith the CI feature set and ignore-regex,--fail-under-lines 90— 93.43% lines, gate passes (control.rs99.11%).